/*
 *
 */
package org.jiscinvolve.astrodabis.barberry.common.data;

import org.jiscinvolve.astrodabis.barberry.common.core.Tag;
import org.jiscinvolve.astrodabis.barberry.common.core.Job;
import org.jiscinvolve.astrodabis.barberry.common.core.Owned;
import org.jiscinvolve.astrodabis.barberry.common.core.Tracked;
import org.jiscinvolve.astrodabis.barberry.common.core.Identified;
import org.jiscinvolve.astrodabis.barberry.common.core.Identifier;

/**
 *
 */
public interface TapJoin
extends Identified
    {

    public enum SelectType
        {
        SAME(),
        SWAP(),
        BOTH();
        };


    public interface Factory
        {

        public Identifier ident(String ident);

        public TapJoin create(TapRow one, TapRow two);
        public TapJoin createQuick(TapRow one, TapRow two);

        public TapJoin select(Identifier ident);

        public Iterable<TapJoin> select();

        public Iterable<TapJoin> select(TapRow row, SelectType type);

        public Iterable<TapJoin> select(TapRow one, TapRow two, SelectType type);

        public TapJoin select(TapRow one, TapRow two);

        }

    public TapRow one();

    public TapRow two();

    public interface JoinTags
        {

        public JoinTag create(Job job, Tag tag);
        public JoinTag createQuick(Job job, Tag tag);

        public JoinTag create(Job job, Tag tag, Double value);
        public JoinTag createQuick(Job job, Tag tag, Double value);

        public Iterable<JoinTag> select();

        public Iterable<JoinTag> select(Tag tag);

        public JoinTag select(Identifier ident);

        }

    public JoinTags tags();

    }

